From 0ca8ed879260749fe06f454eebe6dbb493ded554 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 5 Oct 2011 13:47:02 +0000 Subject: [PATCH] 3 PHP Fatal error: Call to undefined method LocalFile::getFileKey() in /usr/local/apache/common-local/php-1.18/includes/api/ApiUpload.php on line 150 Tag: REL1_18, 1.18wmf1 --- includes/api/ApiUpload.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index d69bc85a5f..961081dfe8 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -175,7 +175,12 @@ class ApiUpload extends ApiBase { */ function performStash() { try { - $fileKey = $this->mUpload->stashFile()->getFileKey(); + $stashFile = $this->mUpload->stashFile(); + + if ( !$stashFile ) { + throw new MWException( 'Invalid stashed file' ); + } + $fileKey = $stashFile->getFileKey(); } catch ( MWException $e ) { $message = 'Stashing temporary file failed: ' . get_class( $e ) . ' ' . $e->getMessage(); wfDebug( __METHOD__ . ' ' . $message . "\n"); -- 2.20.1